<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGcUserImagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gc_user_images', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->default(0)->index();
            $table->unsignedBigInteger('gc_group_id')->default(0)->index();
            $table->string('gc_type')->nullable();
            $table->unsignedBigInteger('gc_category_id')->default(0)->index();
            $table->text('images')->nullable();
            $table->string('title_main')->nullable();
            $table->text('content_main')->nullable();
            $table->string('title_gpt')->nullable();
            $table->text('content_gpt')->nullable();
            $table->integer('change_num')->default(0)->comment('更换文案次数');
            $table->boolean('is_used')->default(false)->comment('是否使用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('gc_user_images');
    }
}
